package com.cbdp.common.aspect;

import com.cbdp.common.result.Result;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 * com.cbdp.common.aspect
 *
 * @author 白雨浓
 * date: 2018/10/26 12:15
 * content:
 */
@Aspect
@Component
public class ResultAspect {

    @Around("execution(public * com.cbdp.*.controller.*.*(..))")
    public Result around(ProceedingJoinPoint joinPoint) throws Throwable {

        var result = joinPoint.proceed();

        return new Result(result);
    }

}
